<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
     <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>Vmall会员管理</title>
		<link rel="stylesheet" href="css/gzh/admin.css" />
		<link rel="stylesheet" href="css/new.css" />
		<link rel="stylesheet" href="css/font-awesome.min.css" />
		<link rel="stylesheet" href="css/font-awesome.css" />
		<link rel="stylesheet" href="css/adminSystem.css" />
		<script src="lib/vue.js"></script>
		<script src="js/gzh/jquery-3.3.1.min.js"></script>
		<script src="lib/bootstrap.min.js"></script>
		<style type="text/css">

		</style>
	</head>

	<body class="fixed skin-blue">
		<div class="wrapper" style="height: auto; min-height: 100%;">
			<header class="main-header">
				<div class="logo">
					<span class="logo-lg"><b>VMALL</b>后台管理</span>
				</div>
				<nav class="navbar navbar-static-top">
					<a href="#" class="sidebar-toggle" data-toggle="push-menu" role="button">
						<span class="sr-only glyphicon glyphicon-th-list"></span>
					</a>

					<!--顶部菜单 开始-->
					<div id="menu" class="navbar-custom-menu">
						<ul class="nav navbar-nav" name="topMenu">
							<li >
								<a hidefocus="true" href="/goods/goods_list">商品</a>
							</li>
							<li class="active">
								<a hidefocus="true" href="/member/member_list">会员</a>
							</li>
							<li>
								<a hidefocus="true" href="/order/order_list">订单</a>
							</li>
							<li>
								<a hidefocus="true" href="/market/pro_rule_list">营销</a>
							</li>
							<li>
								<a hidefocus="true" href="/market/user_reg">统计</a>
							</li>
							<li >
								<a hidefocus="true" href="/system/default">系统</a>
							</li>
							<li>
								<a hidefocus="true" href="/tools/db_bak">工具</a>
							</li>
							<li>
								<a hidefocus="true" href="/plugins/plugin_list">插件</a>
							</li>
							<li>
								<a href="#" data-toggle="control-sidebar"><i class="fa fa-gears"></i></a>
							</li>
						</ul>
					</div>
					<!--顶部菜单 结束-->
				</nav>
			</header>

			<aside id="admin_left" class="main-sidebar">
				<section class="sidebar" style="height: auto;">
					<div class="user-panel">
						<div class="pull-left image">

							<i class="glyphicon glyphicon-user"></i>
						</div>
						<div class="pull-left info">
							<p>admin</p>
							<a href="#">超级管理员</a>
						</div>
					</div>

					<ul class="sidebar-menu tree" data-widget="tree">
						<li class="header">会员模块菜单</li>
						<li class="treeview menu-open">
							<a href="#collapseOne" data-toggle="collapse" data-parent="#accordion">
								<i class="fa fa-home" name="ico" menu="会员管理"></i>
								<span>会员管理</span>
								<span class="pull-right-container">
									<i class="glyphicon glyphicon-chevron-down pull-right"></i>
								</span>
							</a>
							<ul id="collapseOne" class="treeview-menu" name="leftMenu" style="display: block;">
								<li class="active">
									<a href="/system/default"><i class="fa fa-circle-o"></i>会员列表</a>
								</li>
								
							</ul>
						</li>
						<li class="treeview">
							<a href="#collapseTwo" data-toggle="collapse" data-parent="#accordion">
								<i class="fa fa-wrench" name="ico" menu="信息处理"></i>
								<span>信息处理</span>
								<span class="pull-right-container">
									<i class="glyphicon glyphicon-chevron-left pull-right"></i>
								</span>
							</a>
							<ul id="collapseTwo" class="treeview-menu" name="leftMenu">
								<li>
									<a href="/system/conf_base"><i class="fa fa-circle-o"></i>评价管理</a>
								</li>
								<li>
									<a href="/system/conf_guide"><i class="fa fa-circle-o"></i>咨询管理</a>
								</li>
							</ul>
						</li>
						</ul>	
				</section>
			</aside>
			<div id="admin_right" class="content-wrapper" style="min-height: 507px;">
				<div class="breadcrumbs" id="breadcrumbs">
					<ul class="breadcrumb">
						<li>
							<i class="home-icon fa fa-home"></i>
							<a href="#">会员</a>
						</li>
						<li>
							<a href="#">会员管理</a>
						</li>
						<li class="active">会员编辑</li>
					</ul>
				</div>
				<div class="content" style="min-height:880px">
					<form action="/member/member_save" method="post" name="memberForm" novalidate="true">
						<input name="user_id" value="" type="hidden">
						<table class="table form-table">
							<colgroup>
								<col width="130px">
								<col>
							</colgroup>
					
							<tbody>
							 <c:forEach items="${list }" var="user">
								<tr>
									<th>用户名：</th>
									<td><input class="form-control invalid-text" name="username" type="text"  value="${user.nickname}" pattern="required" placeholder="用户名不能为空"></td>
								</tr>
								<tr>
									<th>邮箱：</th>
									<td><input type="text" readonly="readonly" class="form-control" name="email" pattern="email" value="${user.mail}"></td>
								</tr>
								
								
								<tr>
									<th>姓名：</th>
									<td><input class="form-control" readonly="readonly" name="true_name" type="text" value="${user.name}" placeholder="真实的姓名"></td>
								</tr>
								<tr>
									<th>性别：</th>
									<td>
										<label class="radio-inline">
					                            <input type="radio" name="sex" value="0" >男
					                        </label>
										<label class="radio-inline">
					                            <input type="radio" name="sex" value="1">女
					                        </label>
									</td>
								</tr>
								<tr>
									<th>手机：</th>
									<td><input class="form-control" name="mobile" type="text" readonly="readonly" value="${user.tel }" empty="" pattern="mobi" placeholder="手机号码"></td>
								</tr>
								
								<tr>
									<th>QQ：</th>
									<td><input class="form-control" name="qq" type="text" readonly="readonly" value="${user.qq }" empty="" pattern="qq"></td>
								</tr>
								<tr>
									<th>微信：</th>
									<td><input class="form-control" name="qq" type="text" readonly="readonly" value="${user.wechat }" empty="" pattern="qq"></td>
								</tr>
							
								<tr>
									<th>经验值：</th>
									<td><input class="form-control" name="exp" type="text" value="${user.exp }"></td>
								</tr>
								<tr>
									<th>积分：</th>
									<td><input class="form-control" name="point" type="text" value="${user.points }"></td>
								</tr>
								<tr>
									<th>状态：</th>
									<td>
										<select name="status" class="form-control">
											<option value="1">正常</option>
											<option value="0">删除</option>
											
										</select>
									</td>
								</tr>
								<tr>
									<td></td>
									<td><button class="btn btn-primary" type="button" id="submit">确 定</button></td>
								</tr>
								<input type="hidden" id="userid" value="${user.userid}">
<script>
		$(":radio[name='sex'][value='" + ${user.sex} + "']").prop("checked", true);
		$("select[name='status'] option[value='"+ ${user.ifexist} +"']").attr("selected",true);
</script>
								</c:forEach>
							</tbody>
						</table>
					</form>
				</div>
			</div>
		</div>
<script>
		$("#submit").click(function(){
			var userid=$("#userid").val();
			var nikename=$(":text[name='username']").val();
			var sex=$(":radio[name='sex']:checked").val();
			var exp=$(":text[name='exp']").val();
			var points=$(":text[name='point']").val();
			var ifexist=$("select[name='status']").val();
			$.get("AdminMember?method=UserEdit",{userid:userid,nikename:nikename,sex:sex,exp:exp,points:points,ifexist:ifexist},function(e){
    			if (e=="ok") {
    				alert("修改成功");
    				window.location.href="AdminMember";
    			} 
    			else{
    				alert("登录失败");
    				}
    			});
		});
</script>	
		

	</body>

</html>